package com.dms.modules.cart.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@ApiModel("购物车DTO")
public class CartDTO {
    
    @NotNull(message = "用户ID不能为空")
    @ApiModelProperty("用户ID")
    private Long userId;
    
    @NotNull(message = "商品ID不能为空")
    @ApiModelProperty("商品ID")
    private Long productId;
    
    @NotNull(message = "商品数量不能为空")
    @Min(value = 1, message = "商品数量必须大于0")
    @ApiModelProperty("商品数量")
    private Integer quantity;
    
    @NotNull(message = "商品单价不能为空")
    @ApiModelProperty("商品单价")
    private BigDecimal price;
    
    @ApiModelProperty("是否选中：0-未选中，1-已选中")
    private Integer selected = 1;
} 